﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class HalvingEasy : MonoBehaviour {

	// Use this for initialization
	void Start () {
		int[] S = new int[]{987654321, 1000000000, 998244353, 123456789, 999999999};

		Debug.Log(count(S, 1000000000));
	}
	
	// Update is called once per frame
	void Update () {
		
	}

	public int count(int[] S, int T){
		int result = 0;
		for(int i = 0; i < S.Length; i++){
			int temp = S[i];
			while(temp >= T){
				if(temp == T){
					result++;
					break;
				}else{
					temp = temp >> 1;
				}
			}
		}

		return result;
	}
}
